package student.beans;

import java.io.Serializable;

import javax.validation.constraints.Pattern;

import org.springframework.stereotype.Component;

@Component
public class Student implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 841601253144911195L;
	private int stuId;
	@Pattern(regexp="^[\\w\\u2E80-\\u9FFF]{2,10}$",message="姓名不合法")
	private String stuName;
	private int age;
	private char gender;
	@Pattern(regexp="^[1-9][\\d]{4,10}$",message="电话号码不合法")
	private String phone;
	private String address;
	public Student() {
		super();
	}
	public Student(int stuId, String stuName, int age, char gender, String phone, String address) {
		super();
		this.stuId = stuId;
		this.stuName = stuName;
		this.age = age;
		this.gender = gender;
		this.phone = phone;
		this.address = address;
	}
	public int getStuId() {
		return stuId;
	}
	public void setStuId(int stuId) {
		this.stuId = stuId;
	}
	public String getStuName() {
		return stuName;
	}
	public void setStuName(String stuName) {
		this.stuName = stuName;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public char getGender() {
		return gender;
	}
	public void setGender(char gender) {
		this.gender = gender;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	@Override
	public String toString() {
		return "Student [stuId=" + stuId + ", stuName=" + stuName + ", age=" + age + ", gender=" + gender + ", phone="
				+ phone + ", address=" + address + "]";
	}
}
